#ifndef RFID_H
#define RFID_H
#include <QThread>
#include <QObject>
#include "unitclass.h"
#include<QMutex>
#include<QHash>
#include"datebase.h"
#include "maintask.h"
class RFID : public QThread
{
    Q_OBJECT
public:
    RFID(int fd);   
    void runThread();
    QString CardId;     //RFID Only ID
    int test;
    QString Get_CardId;//main thread get
signals:
    void signalToMainrfid(const QString& cid);
public:
    bool FindEPCCard();
    bool GetCardId();
    QString GetId();
    QString hexToString(unsigned char *in, int len);
    bool AnalyzeCarInfo(QString rfid, CardInfo& car_info, QHash<QString, QString> &hash);
protected:
    virtual void run();
private:
    int fd;             //串口句柄
    bool IsFind;
    int m_nottimes;

};

#endif // RFID_H
